import { http } from "@/util/request/index";

// 当前用户的供应商身份
export const currentSupplier = (data) => {
  return http.get("/api/supplier/current/", data);
};

// 供应商总销售数据
export const supplierTotalData = () => {
  return http.get("/api/dashboard/1/supplier/");
};

// 近30天销售数据
export const supplier30DaysData = () => {
  return http.get("/api/dashboard/2/supplier/");
};

// 产品销售top100
export const supplierTop100 = () => {
  return http.get("/api/dashboard/3/supplier/");
};

// 订单来源数量
export const supplierOrderSource = () => {
  return http.get("/api/dashboard/4/supplier/");
};

// 供应商列表
export const supplierList = (params) => {
  return http.get("/api/supplier/", { params });
};

// 获取供应商基础信息
export const supplierDetail = (id) => {
  return http.get(`/api/supplier/${id}/simple/`);
};

// 获取订单列表
export const supplierOrderList = (params) => {
  return http.get("/api/sales/supplier/", { params });
};

// 获取订单详情
export const supplierOrderDetail = (id) => {
  return http.get(`/api/sales/supplier/${id}/`);
};

// 发货
export const supplierOrderDelivery = (id) => {
  return http.post(`/api/sales/supplier/${id}/express/`);
};

// 提现记录
export const supplierWithdrawRecord = (params) => {
  return http.get("/api/supplier/withdrawn/", { params });
};

// 售后列表
export const supplierSaleServices = (params) => {
  return http.get("/api/sales/services/supplier/", { params });
};

// 售后详情
export const supplierSaleServiceDetail = (id) => {
  return http.get(`/api/sales/services/${id}/supplier/`);
};

// 提现
export const supplierWithdraw = (params) => {
  return http.post("/api/supplier/withdrawn/", params);
};
